if ($this.pageType == "add"){
    if ($this.$store.state.user.tabs[$this.$store.state.user.tabs.length - 1]){
        let applicationdata = $this.$store.state.user.tabs[$this.$store.state.user.tabs.length - 1].applicationdata;
        if (applicationdata !== undefined && applicationdata !== "") {
            $this.model["selectStr_1753775292124_OJ7HQ"] = applicationdata[0].项目编号;
            $this.model["input_1753775339004_qFS6R"] = applicationdata[0].项目名称;
            $this.model["table_1753775418247_6gjRn"] = [];

            // 使用Promise.all等待所有异步请求完成
            let promises = [];

            for (let i = 0; i < applicationdata.length; i++) {
                let url = $this.$util.getAPI_URL();
                let formData = new FormData();
                formData.append("id", applicationdata[i]["ID"]);
                url = url.replace("api", "task/taskbyId");

                let promise = $this.$http.post(url, formData).then((res) => {
                    if(res.data.code === 280){
                        let data = res.data.data;
                        let jhsj = [];

                        if(!Array.isArray(res.data.data[0]["rangePicker_1711439307444_Ftzhm"])){
                            let dates = JSON.parse(res.data.data[0]["rangePicker_1711439307444_Ftzhm"]);
                            jhsj = [$this.moment(dates[0], "YYYY-MM-DD HH:mm:ss"), $this.moment(dates[1], "YYYY-MM-DD HH:mm:ss")];
                        } else {
                            jhsj = [$this.moment(res.data.data[0]["rangePicker_1711439307444_Ftzhm"][0], "YYYY-MM-DD HH:mm:ss"), $this.moment(res.data.data[0]["rangePicker_1711439307444_Ftzhm"][1], "YYYY-MM-DD HH:mm:ss")];
                        }

                        $this.model["systemSelect_1762420805262_oAlvn"] = data[0]["systemSelect_1762420635135_c7jc7"];
                        $this.model["systemSelect_1758787997318_kRPLG_ID"] = data[0]["systemSelect_1762420635135_c7jc7_ID"];

                        $this.model["table_1753775418247_6gjRn"].push({
                            body_id: $this.$util.uuid(),
                            create_date: $this.$util.getFormatDate(),
                            index_id: $this.model["table_1753775418247_6gjRn"].length > 0 ? $this.model["table_1753775418247_6gjRn"][$this.model["table_1753775418247_6gjRn"].length - 1].index_id + 1 : 1,
                            body_1753775444811_qlKr5: data[0]["input_1718345101976_ZNGth"],
                            body_1753775446515_MKgFD: data[0]["input_1718345101976_PBcTl"],
                            body_1753775447666_o3Hr5: data[0]["commonNumber_1711532225675_bFKuy"],
                            body_1753775514277_sKUxq: data[0]["input_1711439260720_6QPqX"],
                            body_1753775574914_oXpxZ: data[0]["systemSelect_1711439399614_qXQ72"],
                            body_1753775574914_oXpxZ_ID: data[0]["systemSelect_1711439399614_qXQ72_ID"],
                            body_1753775577331_4oPlP: data[0]["systemSelect_1711504973428_U0If2"],
                            body_1753775577331_4oPlP_ID: data[0]["systemSelect_1711504973428_U0If2_ID"],
                            body_1753775618563_S6ZME: jhsj,
                            body_1753775671262_M0LVJ: data[0]["select_1711505903223_YWk8w"],
                            body_1753775789175_oopZS: data[0]["input_1711439322901_odUPA"],
                            body_1755663443756_SLifs: data[0]["input_1711505283971_PgltR"] == 'true' ? '是' : '否',
                            body_1760163664450_tETTT: data[0]["systemSelect_1711439400905_v5lzI"],
                            body_1760163664450_tETTT_ID: data[0]["systemSelect_1711439400905_v5lzI_ID"],
                            table_body_id: data[0]["bill_id"]
                        });
                    }
                });

                promises.push(promise);
            }

            // 所有异步请求完成后执行时间判断
            Promise.all(promises).then(() => {
                console.log("所有数据加载完成，开始时间判断");
                executeTimeJudgment();
            });
        }
    }
}

// 将时间判断逻辑封装成函数
function executeTimeJudgment() {
    let arr = $this.model["table_1753775418247_6gjRn"];
    console.log("arr = ", arr);
    let hasOverdue = false;

    for(let i = 0; i < arr.length; i++) {
        if(arr[i].body_1753775671262_M0LVJ === "a5e1a504941c1732ee44847e2299fc1c") { //研发计划
            console.log("计划结束时间 = ", arr[i].body_1753775618563_S6ZME[1]);
            if(arr[i].body_1753775618563_S6ZME[1]) {
                const targetDate = new Date(arr[i].body_1753775618563_S6ZME[1]);
                const currentDate = new Date();
                const fourWeeksLater = new Date();
                fourWeeksLater.setDate(currentDate.getDate() + 28);

                console.log("4周测试 = ", fourWeeksLater);
                // 修正逻辑：如果目标时间在4周内，标记为需要关注
                if(targetDate <= fourWeeksLater) {
                    hasOverdue = true;
                    break;
                }
            }
        }
    }

    $this.model.select_1762414301020_eS0lq= hasOverdue ? '是' : '否';
    console.log("最终设置的值:", $this.model.select_1762414301020_eS0lq);
}